<?php
namespace app\Admin\model;

use think\Db;
use think\Model;

class Article extends Model
{
	public function get_Article($where = '')
	{
		return Db::name('consult')->where($where)->select();
	}

	public function get_ArticleOne($id)
	{
		return Db::name('consult')->where(array('id'=>$id))->find();
	}

	public function get_ArticleAdd($data)
	{
		Db::name('consult')->where(array('user_id'=>$data['user_id']))->setInc('consult');
		return Db::table('tp_consult')->insert($data);
	}

	public function get_ArticleEdit($data, $id)
	{
		return Db::table('tp_consult')->where(array('id'=>$id))->update($data);
	}

	public function Del_Article($id)
	{
		return Db::table('tp_consult')->where(array('id'=>$id))->delete();
	}

	public function get_TeamArticle($team_id)
	{
		return Db::name('consult')->where(array('team_id'=>$team_id))->select();
	}
}